package the.workshop.tms.order.interfaces.req;

import lombok.Data;
import org.springframework.beans.BeanUtils;
import the.workshop.tms.order.infrastructure.persistent.model.OrderDO;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

@Data
public class OrderAddReq implements Serializable {

    private String code;

    /**
     * 送货日期
     */
    private Date deliveryDate;

    /**
     * 送货状态
     */
    private Integer deliveryStatus;

    /**
     * 送货班次
     */
    private String deliveryShift;

    /**
     * 发货方联系人
     */
    private String consignorName;

    /**
     * 发货方手机号
     */
    private String consignorTel;

    /**
     * 发货方地址
     */
    private String consignorAddress;

    /**
     * 发货方门牌号
     */
    private String consignorHouseNumber;

    /**
     * 收货人姓名
     */
    private String receiverName;

    /**
     * 收货人手机号
     */
    private String receiverTel;

    /**
     * 收货地址
     */
    private String receiverAddress;

    /**
     * 收货门牌号
     */
    private String receiverHouseNumber;

    /**
     * 货物类别
     */
    private Integer cargoType;

    /**
     * 货物数量
     */
    private BigDecimal cargoNum;

    private String driverName;
    private String vehicleNumber;
    /**
     * 拉包工
     */
    private String carrierName;
    private BigDecimal driverFee;
    private BigDecimal carrierFee;
    private BigDecimal totalFee;
    private Integer payStatus;
    private String remark;
    private BigDecimal marketAmount;

    public OrderDO toOrder() {
        OrderDO target = new OrderDO();
        BeanUtils.copyProperties(this, target);
        return target;
    }
}
